﻿using AutoMapper;
using NetTaste;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using VM.Common.Result;
using VM.Entity.EntityDto.Invoice;
using VM.Entity.EntityMap.Member;
 
using VM.Entity.EntityMap.System.Code;
using VM.Entity.EntityMap.Topic;
using VM.IDAL.Invoice;

namespace VM.DAL.Invoice
{
    public class InVoiceDAL : BaseDAL, IInVoiceDAL
    {

        protected ISqlSugarClient _Client { get; set; }
        protected IMapper _IMapper { get; set; }


        public InVoiceDAL(ISqlSugarClient client, IMapper iMapper) : base(client)
        {
            _Client = client;
            _IMapper = iMapper;
        }


 
        /// <summary>
        /// 添加发票本地申请数据
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public bool addInvoice(invoiceApllyDto obj)
        {
            
            bool Res = _Client.InsertNav(obj)
                      .Include(a => a.reqJson).ThenInclude(b => b.AdditionalElementList)
                      .Include(a => a.reqJson).ThenInclude(b => b.invoiceDetail)
                      .ExecuteCommand();
            return Res;
        }

 
    }
}
